package com.globo.devsup.client.presenter;

import com.globo.devsup.client.presenter.listener.PrincipalListener.PrincipalPanelListener;
import com.globo.devsup.client.view.IView;
import com.globo.devsup.client.view.LoginView;
import com.globo.devsup.client.view.PrincipalView;
import com.globo.devsup.client.vo.BaseVO;

public class PrincipalPresenter extends BasePresenter {

	public PrincipalPresenter() {
		setView(new PrincipalView(this));
    }
    
    public IView pack() {
        return (PrincipalView)super.pack();
    }
    
    public void setUpViewListeners() {
    	PrincipalView view = ((PrincipalView)getView());
        view.setPanelActionListener(new PrincipalPanelListener(this));
    }
    
    public void updateModelFromView(BaseVO vo) {
        
    }
    
    public void updateViewFromModel(BaseVO vo) {
        
    }
    
    
    /**
     * ######################## STRATEGIES ########################
     */
    
    public final Strategy LOAD_PANEL_STRATEGY = new LoadPanelStrategy();
    
    private class LoadPanelStrategy implements Strategy {
        public void execute() {
        	LoginView loginWindow = (LoginView)new LoginPresenter().pack();
        	loginWindow.show();
        }
    }
}
